<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
 <div id="div">{{name}}
 <button @click="sendMsg()">按钮</button>
 </div>
</body>
<script src="../vue/vue.js"></script>
<script src="../vue/axios-0.18.0.js"></script>
<script>
        new Vue({
            el:"#div",
            data:{name:"daqiang"},
            methods:{
                sendMsg(){
                    //../testServlet?name=  也是可以的
                    axios.get("/vue01/testServlet?name="+this.name).then(resp=>{
                        alert(resp.data);
                    })
                }
           /*     sendMsgp(){
                    axios.post("testServlet","name="+this.name).then(resp=>{
                        alert(resp.data)
                    })
                }*/
            }
        });
</script>
</html>